def lowbit(x):
    return x&(-x)

# a[x] +=y
def add(x,y,tree,n):
    while x <= n:
        tree[x] +=y
        x += lowbit(x)


# 查询 a[1]+...+a[x]
def query(x,tree):
    ans=0
    while x:
        ans+=tree[x]
        x -= lowbit(x)
    return ans

n=int(input())
a=[0] + list(map(int,input().split()))

tree = [0]*(n+1)
# 初始化 树状数组
for i in range(1,n+1):
    add(i,a[i],tree,n)

m=int(input())
for i in range(m):
    q,x,y=map(int,input().split())
    if q==1:
        add(x,y,tree,n)
    else:
        print(query(y,tree)-query(x-1,tree))
